#include "hujz_java_file_server_NativeInterface.h"

extern int _initializes();
extern int _destroys();
extern int _convert(char *filename, char *output, int width, int height);

/*
 * Class:     hujz_java_file_server_NativeInterface
 * Method:    initializes
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_hujz_java_file_1server_NativeInterface_initializes(
    JNIEnv *env, jobject obj) {
    _initializes();
}

/*
 * Class:     hujz_java_file_server_NativeInterface
 * Method:    resize
 * Signature: (Ljava/lang/String;Ljava/lang/String;II)V
 */
JNIEXPORT jint JNICALL Java_hujz_java_file_1server_NativeInterface_resize(
    JNIEnv *env, jobject obj, jstring uri, jstring out, jint width,
    jint height) {
    char *_uri = (char *)(*env)->GetStringUTFChars(env, uri, JNI_FALSE);
    char *_out = (char *)(*env)->GetStringUTFChars(env, out, JNI_FALSE);
    jint ret = (jint)_convert(_uri, _out, width, height);
    (*env)->ReleaseStringUTFChars(env, uri, _uri);
    (*env)->ReleaseStringUTFChars(env, out, _out);
    return ret;
}
/*
 * Class:     hujz_java_file_server_NativeInterface
 * Method:    destroys
 * Signature: ()V
 */
JNIEXPORT void JNICALL
Java_hujz_java_file_1server_NativeInterface_destroys(JNIEnv *env, jobject obj) {
    _destroys();
}